import requests

from conf.readconf import ReadConf

rc = ReadConf()

#  封装登录接口，返回token值
def get_crm_token():
    url = rc.get_crm("crm_url")
    parm = {"username": "18329799711", "password": 123456}
    response_result = requests.post(url + "/login", data=parm, timeout=2)
    crm_json = response_result.json()
    crm_token = crm_json['Admin-Token']
    return crm_token





